import request from '@/utils/api'

export function login (data) {

  return request({
    url: '/api/user/login',
    method: 'post',
    data
  })
}

export function getInfo (token) {
  return request({
    url: '/api/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout () {
  return request({
    url: '/api/user/logout',
    method: 'post'
  })
}


export function listUser (param) {
  return request({
    url: 'api/user/listPage',
    method: 'get',
    params: param
  })

}

export function userRole (param) {
  return request({
    url: 'api/user/userRole',
    method: 'get',
    params: param
  })

}


export function addUser (data) {
  return request({
    url: '/api/user',
    method: 'put',
    data
  })
}

export function updateUser (data) {
  return request({
    url: '/api/user',
    method: 'post',
    data
  })
}

export function deleteUser (data) {
  return request({
    url: '/api/user',
    method: 'delete',
    data
  })
}


export function listActiveHosp(params) {
  return request({
    url: '/api/hosp/listActive',
    method: 'get',
    params
  })
}
